import os
import sys
from limber import abilities

DIRNUMBER = 1

ROOTPATH = os.path.dirname((os.path.realpath(__file__)))
USERDIR_PATH = os.path.join(ROOTPATH, 'mock-userdir')
SYSTEMDIR_PATH = os.path.join(ROOTPATH, 'mock-systemdir')

MOCK_TAB_VIEW_DISPLAY_INFOS = {
    'name' : 'mock_tab_view_display',
    'full_name' : 'MockTabViewDisplay',
    'version' : '0.1.0',
    'short_description' : 'A simple view display.',
    'directory' : os.path.join(USERDIR_PATH, 'Widgets'),
    'filename' : 'mock_tab_view_display.py',
    'abilities' : ['TEXT'],
    'interface' : 'viewdisplayer',
    'author' : 'Giacomo Alzetta',
    'author_email' : 'giacomo.alzetta@gmail.com',
    'license' : 'GPL3'
    }

MOCK_IMAGE_DOCUMENT_INFOS = {
    'name' : 'mock_image_document',
    'full_name' : 'MockImageDocument',
    'version' : '0.1.3a',
    'short_description' : 'A simple mock document',
    'directory' : os.path.join(SYSTEMDIR_PATH, 'Widgets'),
    'filename' : 'mock_image_document.py',
    'abilities' : ['BINARY', 'IMAGE_BINARY'],
    'interface' : 'document',
    'author' : 'Giacomo Alzetta',
    'author_email' : 'giacomo.alzetta@gmail.com',
    'license' : 'GPL3',
    }

MOCK_TEXT_DOCUMENT_INFOS = {
    'name' : 'mock_text_document',
    'full_name' : 'MockTextDocument',
    'version' : '0.0.1',
    'short_description' : 'A simple mock document',
    'directory' : os.path.join(SYSTEMDIR_PATH, 'Widgets'),
    'filename' : 'mock_text_document.py',
    'abilities' : ['TEXT', 'PLAIN_TEXT', 'HTML_TEXT'],
    'interface' : 'document',
    'author' : 'Giacomo Alzetta',
    'author_email' : 'giacomo.alzetta@gmail.com',
    'license' : 'GPL3',
    }

INFOS = [
    MOCK_TAB_VIEW_DISPLAY_INFOS,
    MOCK_IMAGE_DOCUMENT_INFOS,
    MOCK_TEXT_DOCUMENT_INFOS,
    ]

sys.path.insert(0, os.path.join(USERDIR_PATH, 'Widgets'))
from mock_tab_view_display import MockTabViewDisplay
sys.path.pop(0)

sys.path.insert(0, os.path.join(SYSTEMDIR_PATH, 'Widgets'))
from mock_image_document import MockImageDocument
from mock_text_document import MockTextDocument
sys.path.pop(0)

COMPONENTS_TEST_0 = (
    MockTabViewDisplay,
    MockImageDocument,
    MockTextDocument,
    )

COMPONENTS = [
    COMPONENTS_TEST_0,
    ]

MOCK_TAB_VIEW_DISPLAY_ABILITIES = (
    abilities.TEXT, )

MOCK_IMAGE_DOCUMENT_ABILITIES = (
    abilities.BINARY,
    abilities.IMAGE_BINARY,
    )

MOCK_TEXT_DOCUMENT_ABILITIES = (
    abilities.TEXT,
    abilities.PLAIN_TEXT,
    abilities.HTML_TEXT,
    )

COMPONENTS_AND_ABILITIES_TEST_0 = (
    (MockTabViewDisplay, MOCK_TAB_VIEW_DISPLAY_ABILITIES),
    (MockImageDocument, MOCK_IMAGE_DOCUMENT_ABILITIES),
    (MockTextDocument, MOCK_TEXT_DOCUMENT_ABILITIES)
    )

COMPONENTS_AND_ABILITIES = [
    COMPONENTS_AND_ABILITIES_TEST_0,
    ]
